﻿@{
    Layout = null;
}
<!DOCTYPE HTML>
<html lang="zh-cn">
<head>
    <meta charset="utf-8">
    <!--<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">-->

    <title>HyEduOnline--平台管理登录页面 </title>
    <meta name="description" content="">
    <meta name="author" content="">


    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">

    <!-- Basic Styles -->
    <link rel="stylesheet" type="text/css" media="screen" href="~/css/bootstrap.min.css">
    <link rel="stylesheet" type="text/css" media="screen" href="~/css/font-awesome.min.css">

    <!-- SmartAdmin Styles : Please note (smartadmin-production.css) was created using LESS variables -->
    <link rel="stylesheet" type="text/css" media="screen" href="~/css/smartadmin-production.css">
    <link rel="stylesheet" type="text/css" media="screen" href="~/css/smartadmin-skins.css">

    <!-- SmartAdmin RTL Support is under construction
			<link rel="stylesheet" type="text/css" media="screen" href="css/smartadmin-rtl.css"> -->


    <!-- FAVICONS -->
    <link rel="shortcut icon" href="/img/favicon/favicon.ico" type="image/x-icon">
    <link rel="icon" href="/img/favicon/favicon.ico" type="image/x-icon">

    <script src="~/Js/libs/jquery-2.1.3.min.js"></script>

    

    <style type="text/css">

        .state-error .help-block {
            color: #a90329;
        }
         .state-success .help-block {
            color: #6fb679;
        }
    </style>
</head>
<body id="login" class="animated fadeInDown">
    <!-- possible classes: minified, no-right-panel, fixed-ribbon, fixed-header, fixed-width-->
    <header id="header">
        <!--<span id="logo"></span>-->

        <div id="logo-group">

            <span id="logo" style="font-family: 'Microsoft YaHei'; font-size: 20pt; font-weight: bolder; width: 400px; margin-top: 10px;">

                <img style="height: 50px; width: 50px;" src="~/Images/login/99com.png" />自主学习平台
                
            </span>

            <!-- END AJAX-DROPDOWN -->
        </div>

       
    </header>

    <div id="main" role="main">

        <!-- MAIN CONTENT -->
        <div id="content" class="container">

            <div class="row">
                <div class="col-xs-12 col-sm-12 col-md-7 col-lg-8 hidden-xs hidden-sm" id="div">
                    <h1 class="txt-color-red login-header-big">自主学习平台</h1>
                    <div class="hero">

                        <div class="pull-left login-desc-box-l">
                            <h4 class="paragraph-header">教育系统是一套为中国企业推出的为企业持续提供全方位各阶段人才教育培训和考核的系统平台。结合行内远程教育数字化标准、以及独创专用的用户体验技术。同时结合多点网络多媒体视音频互动的特色，能够实现远程视/音频培训、学习、交流互动。</h4>

                        </div>

                        <img src="/img/demo/iphoneview.png" class="pull-right display-image" alt="" style="width: 210px">
                    </div>

                   

                </div>
                <div class="col-xs-12 col-sm-12 col-md-5 col-lg-4">
                    <div class="well no-padding">
                        <form id="login-form" class="smart-form client-form">
                            <header>
                                登录
                            </header>

                            <fieldset>

                                <section>
                                    <label class="label">登录名</label>
                                    <label class="input">
                                        <i class="icon-append fa fa-user"></i>
                                        <input id="txt_loginName" name="txt_loginName">
                                        <b class="tooltip tooltip-top-right"><i class="fa fa-user txt-color-teal"></i>请输入用户名</b></label>
                                    <p class="help-block">请输入登录名,必填</p>



                                </section>

                                <section>
                                    <label class="label">密码</label>
                                    <label class="input">
                                        <i class="icon-append fa fa-lock"></i>
                                        <input type="password" name="txt_password" id="txt_password">
                                        <b class="tooltip tooltip-top-right"><i class="fa fa-lock txt-color-teal"></i>请输入密码</b>
                                        <p class="help-block">请输入密码,必填</p>
                                    </label>

                                </section>

                                <section>
                                    <label class="checkbox">
                                        <input type="checkbox" name="remember" checked="">
                                        <i></i>自动登录</label>
                                </section>
                            </fieldset>
                            <footer>
                                <button type="button" class="btn btn-primary" onclick="login();">
                                    登录
                                </button>
                            </footer>
                        </form>

                    </div>
                </div>
            </div>
        </div>

    </div>

    <!--================================================== -->



    <!--================================================== -->


    <!-- BOOTSTRAP JS -->
    <script src="~/js/bootstrap/bootstrap.min.js"></script>

    <!-- CUSTOM NOTIFICATION -->
    <script src="~/js/notification/SmartNotification.min.js"></script>

    <!-- JARVIS WIDGETS -->
    <script src="~/js/smartwidgets/jarvis.widget.min.js"></script>

    <!-- EASY PIE CHARTS -->
    <script src="~/js/plugin/easy-pie-chart/jquery.easy-pie-chart.min.js"></script>

    <!-- SPARKLINES -->
    <script src="~/js/plugin/sparkline/jquery.sparkline.min.js"></script>

    <!-- JQUERY VALIDATE -->
    <script src="~/js/plugin/jquery-validate/jquery.validate.min.js"></script>

   

    <!-- JQUERY SELECT2 INPUT -->
    <script src="~/js/plugin/select2/select2.min.js"></script>

    <!-- JQUERY UI + Bootstrap Slider -->
    <script src="~/js/plugin/bootstrap-slider/bootstrap-slider.min.js"></script>

    <!-- browser msie issue fix -->
    <script src="~/js/plugin/msie-fix/jquery.mb.browser.min.js"></script>

    <!-- FastClick: For mobile devices -->
    <script src="~/js/plugin/fastclick/fastclick.js"></script>

    <!-- MAIN APP JS FILE -->
    <script src="~/js/app.js"></script>

    <!-- PAGE RELATED PLUGIN(S) -->


    <script type="text/javascript">
        $(function () {

            $("body").keypress(function (event) {
                if (event.keyCode == 13) {
                    login();
                }
            });

            $("#login-form").validate({

                rules:
                        {
                            txt_loginName:
                                {
                                    required: true

                                },
                            txt_password:
                                {
                                    required: true
                                }

                        }
                        ,
                messages:
                    {
                        txt_loginName:
                            {
                                required: "用户名不能为空",

                            },
                        txt_password:
                           {
                               required: "密码不能为空"
                           }

                    },
                highlight: function (element, errorClass, validClass) {
                    $(element).closest('section').removeClass('state-success').addClass('state-error');
                },
                unhighlight: function (element, errorClass, validClass) {
                    $(element).closest('section').removeClass('state-error').addClass('state-success');
                },
                success: function (label) {
                    $(label).closest('form').find('.valid').removeClass("invalid");
                },
                errorPlacement: function (error, element) {
                    element.closest('section').find('.help-block').html(error.text());
                }
            });//end rule


        });


        function login() {
            $("#login-form").valid();
            var loginName = $("#txt_loginName").val();
            var password =$("#txt_password").val();
            var obj = new Object();


            var apiurl = "/api/SysUser/SysUser?UserName=" + loginName + "&PassWord=" + password;
            
            $.ajax({
                url: apiurl,
                cache: false,
                type: 'POST',
                contentType: 'application/json; charset=utf-8',
            })
            .done(
                function (result) {
                    switch (result) {
                        case "1":
                            location.href = "/SysManger/Index#/SysManger/Home";
                            
                            break;
                        case "0":
                            alert("错误的用户名和密码!");
                            break;
                        case "-1":
                            alert("非法参数");
                            break;
                        case "-2":
                            alert("错误的验证码");
                            break;
                        case "-3":
                            alert("出错了！无法接受的用户名/密码!");
                            break;
                    }
                })

            .fail(
             function () {
                 alert("请求信息错误 ");
             }
            );

        }//end login
    </script>

</body>
</html>
